<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<title>Document</title>
	</head>
	<body>
		<script>
			// 求出所有的水仙花数，水仙化数为3位数，并且每位上的数字的立方和等于该数本身。
			let g, s, b;
			for (let num = 100; num <= 999; num++) {
				g = parseInt(num % 10);
				s = parseInt((num / 10) % 10);
				b = parseInt(num / 100);
				if (num == g * g * g + s * s * s + b * b * b) {
					console.log(num);
				}
			}
		</script>
	</body>
</html>
